import java.io.*;

public class MultipyExceptSelf {
 public static void main(String[] args) throws 
     RuntimeException, IOException {
  BufferedReader br = 
    new BufferedReader(
      new InputStreamReader(System.in));
  int N = Integer.parseInt(br.readLine());
  long a[] = new long[N];
  long prod = 1;
  int zerocount = 0;
  for (int i = 0; i < N; i++) {
   a[i] = Long.parseLong(br.readLine());
   if (a[i] == 0) {
    zerocount++;
   } else {
    prod *= a[i];
   }
  }
  if (zerocount > 1) {
   for (int i = 0; i < N; i++) {
    System.out.println(0);
   }
   // none or only one zero in array
  } else {
   for (int i = 0; i < N; i++) {
    if (a[i] == 0) {
     System.out.println(prod);
    } else {
     // one zero in array
     if (zerocount > 0) {
      System.out.println(0);
      // no zeroes in array
     } else {
      System.out.println(prod / a[i]);
     }
    }
   }
  }
 }
}